//
// File: fft.cpp
//
// MATLAB Coder version            : 4.0
// C/C++ source code generated on  : 18-Dec-2020 16:50:24
//

// Include Files
#include "rt_nonfinite.h"
#include "sea_parameter_cal.h"
#include "fft.h"
#include "fft1.h"
#include "permute.h"

// Function Definitions

//
// Arguments    : const creal_T x[4194304]
//                creal_T y[4194304]
// Return Type  : void
//
void fft(const creal_T x[4194304], creal_T y[4194304])
{
  static creal_T dcv5[4194304];
  static const double dv3[33] = { 1.0, 0.99518472667219693, 0.98078528040323043,
    0.95694033573220882, 0.92387953251128674, 0.881921264348355,
    0.83146961230254524, 0.773010453362737, 0.70710678118654757,
    0.63439328416364549, 0.55557023301960218, 0.47139673682599764,
    0.38268343236508978, 0.29028467725446233, 0.19509032201612825,
    0.0980171403295606, 0.0, -0.0980171403295606, -0.19509032201612825,
    -0.29028467725446233, -0.38268343236508978, -0.47139673682599764,
    -0.55557023301960218, -0.63439328416364549, -0.70710678118654757,
    -0.773010453362737, -0.83146961230254524, -0.881921264348355,
    -0.92387953251128674, -0.95694033573220882, -0.98078528040323043,
    -0.99518472667219693, -1.0 };

  static const double dv4[33] = { 0.0, -0.0980171403295606, -0.19509032201612825,
    -0.29028467725446233, -0.38268343236508978, -0.47139673682599764,
    -0.55557023301960218, -0.63439328416364549, -0.70710678118654757,
    -0.773010453362737, -0.83146961230254524, -0.881921264348355,
    -0.92387953251128674, -0.95694033573220882, -0.98078528040323043,
    -0.99518472667219693, -1.0, -0.99518472667219693, -0.98078528040323043,
    -0.95694033573220882, -0.92387953251128674, -0.881921264348355,
    -0.83146961230254524, -0.773010453362737, -0.70710678118654757,
    -0.63439328416364549, -0.55557023301960218, -0.47139673682599764,
    -0.38268343236508978, -0.29028467725446233, -0.19509032201612825,
    -0.0980171403295606, -0.0 };

  static creal_T b_y1[4194304];
  int k;
  int b_k;
  int c_k;
  b_permute(x, dcv5);
  c_r2br_r2dit_trig(dcv5, dv3, dv4, b_y1);
  for (k = 0; k < 256; k++) {
    for (b_k = 0; b_k < 256; b_k++) {
      for (c_k = 0; c_k < 64; c_k++) {
        y[(b_k + (k << 8)) + (c_k << 16)] = b_y1[(c_k + (b_k << 6)) + (k << 14)];
      }
    }
  }
}

//
// File trailer for fft.cpp
//
// [EOF]
//
